In [ ]:
%%bash
cd cifar10
MODEL_NAME="cifar10"
VERSION_NAME="v1"
JOB_DIR="gs://dost_deeplearning_cifar10/cifar10_train_1499931245" # Change this to your own
gcloud ml-engine models create $MODEL_NAME
gcloud ml-engine versions create \
$VERSION_NAME \
--model $MODEL_NAME \
--origin $JOB_DIR/model
In [ ]:
%%bash
cd cifar10
MODEL_NAME="cifar10"
VERSION_NAME="v1"
gcloud ml-engine predict \
--model $MODEL_NAME \
--version $VERSION_NAME \
--json-instances predict_test.json
It should output 6 which is the label index for the frog class.
In [ ]:
!pip install -r emojify/requirements.txt
In [ ]:
import os
import subprocess
import IPython
from google.datalab.utils import pick_unused_port
port = pick_unused_port()
# Config is reckoned from env vars
env = {
'PROJECT_ID': 'dost-deeplearning', # Change this to your project id
'MODEL_NAME': 'cifar10',
'PORT': str(port),
}
args = ['python', 'emojify/emojify.py']
subprocess.Popen(args, env=env)
url = '/_proxy/%d/' % port
html = 'Running emojify! Click <a href="%s" target="_blank">here</a> to access it.' % url
IPython.display.display_html(html, raw=True)